<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
 <?php
  if($_REQUEST['img']!='')
  {
  //require_once("../../classes/config.php");
  $connection=mysql_connect("localhost", "root", ""); 

//Select database, database_name needs to be changed 
	mysql_select_db("database_name"); 
	echo"my picture";
  $imgtest="select * from photoUploadDemo where filename='".base64_decode($_REQUEST['img'])."'";
  $showphoto=mysql_query($imgtest);
  $shownum=mysql_num_rows($showphoto);
  if($shownum>=1)
  {
	$show=mysql_fetch_array($showphoto);  
	?>
    <img src="images/<?php echo $show['filename']; ?>" />
    <?php
  }
  }
  if($_REQUEST['mgs']=='error')
  {
	  ?>
      <span style="color:#F00;"> Some Error !!!</span>
      <?php
  }
  ?>
</body>
</html>